#ifndef __N_EOPLL_H
#define __N_EOPLL_H
typedef struct epoll_data_s EpollData;
typedef struct poller_s     Poller_t;
struct epoll_data_s {
    union func_S {
        struct {
            void (*readHandle)(EpollData* this);
            void (*writeHandle)(EpollData* this);
        };
        void (*listenHandle)(EpollData* this);
    } func;
#define READEVENT   1 << 0 //读事件
#define WRITEEVENT  1 << 1 //写事件
#define LISTENEVENT 1 << 2 //监听事件
#define ETMODE      1 << 3 //边沿触发，默认设置是LT水平触发

    int   fd;
    void* ctx;
    int   mode;
};
Poller_t* pollCreate(int max_openfds);

int pollAdd(EpollData* data, Poller_t* poller);

int pollStart(Poller_t* poller);

int pollDel(EpollData* data, Poller_t* poller);

int pollChangeMode(int mode, EpollData* data, Poller_t* poller);

int pollDestroy(Poller_t* poller);
#endif